﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;
using TanmiaGrp.GeneralLedger.Core;
using WpfApplication1.Commands;

namespace WpfApplication1
{
    public class MainWindowViewModel : NotificationObject
    {
        private List<Account> accounts;

        public ObservableCollection<VoucherLine> Lines { get; set; }
        public List<Account> Accounts
        {
            get { return accounts; }
            set
            {
                if (accounts != value)
                {
                    accounts = value;
                    RaisePropertyChanged(() => Accounts);
                }
            }
        }

        public ICommand DebugCommand { get; private set; }

        public MainWindowViewModel()
        {
            DebugCommand = new DelegateCommand(OnDebug);
            Accounts = new List<Account>()
            {
                new Account { AccountID = 1, AccountName = "رياض" },
                new Account { AccountID = 2, AccountName = "نثريات" },
                new Account { AccountID = 3, AccountName = "صندوق" },
                new Account { AccountID = 4, AccountName = "روبوت" },
                new Account { AccountID = 5, AccountName = "رياضة" },
                new Account { AccountID = 6, AccountName = "رياضيات" }
            };

            Lines = new ObservableCollection<VoucherLine>();
        }

        private void OnDebug()
        {
            object obj = Lines;
        }
    }
}
